package com.example.wechat;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ContactApi {
    @GET("contacts")
    Call<Response<List<Contact>>> getAllContacts();

    @GET("contacts/group/{groupName}")
    Call<Response<List<Contact>>> getContactsByGroup(@Path("groupName") String groupName);

    @POST("contacts")
    Call<Response<Contact>> addContact(@Body Contact contact);

    @PUT("contacts/{contactId}")
    Call<Response<Contact>> updateContact(@Body Contact contact);

    @DELETE("contacts/{contactId}")
    Call<Response<Void>> deleteContact(@Path("contactId") String contactId);

    @POST("contacts/{contactId}/avatar")
    Call<Response<String>> uploadAvatar(@Path("contactId") String contactId, @Body String base64Avatar);

    @PUT("contacts/{contactId}/remark")
    Call<Response<Contact>> updateRemark(@Path("contactId") String contactId, @Query("remark") String remark);

    @PUT("contacts/{contactId}/group")
    Call<Response<Contact>> updateGroup(@Path("contactId") String contactId, @Query("group") String group);

    Call<Response<Contact>> updateContact(Object contact);
}